package cn.stylefeng.guns.modular.business.frequency.pricelibrary.service;

import cn.stylefeng.guns.core.pojo.page.PageResult;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.entity.PriceLibrary;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.param.PriceLibraryDTO;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.param.PriceLibraryParam;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.result.PickTakePrice;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.result.PkgPriceLibrary;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;

/**
 * 价格库 服务类
 *
 * @author yujie
 * @date 2023/05/09 17:16
 */
public interface PriceLibraryService extends IService<PriceLibrary> {

    /**
     * 分页查询价格库
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    PageResult<PriceLibrary> page(PriceLibraryParam priceLibraryParam);

    /**
     * 查询所有价格库
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    List<PriceLibrary> list(PriceLibraryParam priceLibraryParam);

    /**
     * 添加价格库
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void add(PriceLibraryParam priceLibraryParam);

    /**
     * 删除价格库
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void delete(PriceLibraryParam priceLibraryParam);

    /**
     * 编辑价格库
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void edit(PriceLibraryParam priceLibraryParam);

    /**
     * 查看详情价格库
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    PriceLibrary detail(PriceLibraryParam priceLibraryParam);

    /**
     * 修改状态（字典 0正常 1停用 2删除）
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void changeStatus(PriceLibraryParam priceLibraryParam);

    Page<PkgPriceLibrary> getPriceLibraryListPage(Page<Object> defaultPage, PriceLibraryDTO priceLibraryDTO,Long tenantId);

    boolean checkPriceLibraryAdd(PriceLibrary priceLibrary, StringBuilder errorMsg);

    void addLine(PriceLibrary priceLibrary);

    boolean checkPriceLibraryUpdate(PriceLibrary priceLibrary, StringBuilder errorMsg);

    void lineUpdate(PriceLibrary priceLibrary);

    void lineCheck(PriceLibrary priceLibrary);

    void disableOrStart(String id);

    List<PkgPriceLibrary> priceLibrarySearch(PriceLibraryDTO priceLibraryDTO,Long tenantId);

    List<PriceLibrary> getExportDataList();

    void importExcel(MultipartFile file) throws IOException;

    Page getPickTakePriceListPage(PriceLibraryDTO pickTakePriceDTO);

    BigDecimal getPickFeeByAreaCode(PriceLibraryDTO pickTakePriceDTO);

    BigDecimal getTakeFeeByAreaCode(PriceLibraryDTO pickTakePriceDTO);

    //void updatePickTakePrice(PickTakePrice pickTakePrice);

    PkgPriceLibrary getMinimumPrice(PriceLibraryDTO priceLibraryDTO);

    PkgPriceLibrary getDetailById(String id);

}